package tomsung.cloud.agdc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tomsung.cloud.agdc.bean.City;
import tomsung.cloud.agdc.dao.CityMapper;

@Service("CityService")
public class CityService {

	@Autowired
	CityMapper cityMapper;
	
	public int createCity(City record)
	{
		return cityMapper.insertSelective(record);
	}
	
	public int deleteCity(Integer id, Integer provinceId)
	{
		return cityMapper.deleteByPrimaryKey(id, provinceId);
	}
	
	public City selectCity(Integer id, Integer provinceId)
	{
		return cityMapper.selectByPrimaryKey(id, provinceId);
	}
	
	public int updateCity(City record)
	{
		return cityMapper.updateByPrimaryKey(record);
	}
	
	public List<City> getAllCitys()
	{
		return cityMapper.getAllCitys();
	}
}
